solving word problem using model method